The following types of system are known: on grid and off grid.
On-grid systems are systems that generate power on an available electrical grid. With this type of system, it is possible only to inject the generated power into the grid. No storage is possible.
Off-grid systems are not connected to a public grid and are considered not to be linked to the main or national electrical grid. With this type of system, it is only possible to store and/or to self-consume the generated power. No injection into the grid is possible. In this type of system, it is necessary to use a load regulator which involves additional losses over the entire system.
Off-grid systems also use the all-or-nothing principle for electrical output, either by the batteries or by the public electricity grid. These power relays create brownouts when they transfer power from one source to another.
The power of off-grid inverters is identical at input and output, i.e. the aggregated power of the loads at output is limited.
An off-grid system consists of multiple elements, which involves complex wiring and a bulky system.
A power management method taking solar panels into consideration is known from document US2011/140667. The method described in this document makes it possible to control either the injection of electrical power from the solar panel or the battery into a residence or into the electrical grid, or the consumption of electrical power on the public electricity grid in order to charge the battery, according to a predetermined reference level of power consumed by the residence or the electrical grid. This method is designed so that the delivery point (the electricity meter of the public electricity grid) measures consumed power as constantly as possible throughout the day and does so under any conceivable circumstances relating to the power consumption of the residence or of the local electrical grid, the power generated by the solar panel and the power stored in the battery. Thus, the method injects current from the solar panel or the battery into the residence or the local electrical grid if the power consumed by the residence or the local electrical grid is more than the predetermined reference power. The method consumes current from the public electricity grid in order to charge the battery if the power consumed by the residence or the local electrical grid is less than the predetermined reference power. The method is composed of at least one battery cell using electrochemical accumulator technology.
However, this document does not teach how to optimize the management of power flows with the aim of decreasing the cost per kWh generated by the power source as much as possible. It does not include, for example, the possibility to:                use the power generated by the solar panels to supply power to the electrical output, the public electricity grid and to charge the battery at the same time;        charge the battery using both the power generated by photovoltaics and the public electricity grid at the same time;        supply the electrical output with the power generated by the solar panels, the battery and the public electricity grid at the same time;        supply the public electricity grid using the power generated by the solar panels and batteries at the same time.        
It does not include the possibility to use batteries other than those employing electrochemical accumulator technology, such as, in particular, flywheel storage.